import { axios } from '@/utils/request'
import api from '@/api/apiUrl'

export function getAccountList (parameter) {
  return axios({
    url: api.Accounts,
    method: 'post',
    data: parameter
  })
}

export function SaveAccount (parameter) {
  return axios({
    url: api.Account,
    method: 'post',
    data: parameter
  })
}

export function DelAccount (parameter) {
  return axios({
    url: api.Account,
    method: 'delete',
    data: parameter
  })
}

export function ChangePassword (parameter) {
  return axios({
    url: api.ChangePassword,
    method: 'post',
    data: parameter
  })
}

export function GetRoleList (parameter) {
  return axios({
    url: api.Roles,
    method: 'post',
    data: parameter
  })
}

export function SaveRole (parameter) {
  return axios({
    url: api.Role,
    method: 'post',
    data: parameter
  })
}

export function DelRole (parameter) {
  return axios({
    url: api.Role,
    method: 'delete',
    data: parameter
  })
}
// 查询菜单列表
export function GetMenuList (parameter) {
  return axios({
    url: api.Menus,
    method: 'post',
    data: parameter
  })
}
// 保存菜单
export function SaveMenu (parameter) {
  return axios({
    url: api.Menu,
    method: 'post',
    data: parameter
  })
}
// 删除菜单
export function DelMenu (parameter) {
  return axios({
    url: api.Menu,
    method: 'delete',
    data: parameter
  })
}

export function getUserInfoForConDep (parameter) {
  return axios({
    url: '/systemAdmin/selectUserInfoForConDep',
    method: 'post',
    data: parameter
  })
}

export function getUserConDep (parameter) {
  return axios({
    url: '/systemAdmin/userConDeps',
    method: 'post',
    data: parameter
  })
}

export function saveUserConDep (parameter) {
  return axios({
    url: '/systemAdmin/userConDep',
    method: 'post',
    data: parameter
  })
}

export function delUserConDep (parameter) {
  return axios({
    url: '/systemAdmin/userConDep',
    method: 'delete',
    data: parameter
  })
}
